package com.lianmai.chaincard.view.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lianmai.chaincard.R;
import com.lianmai.chaincard.bean.Movie;
import com.youth.xframe.utils.http.HttpCallBack;
import com.youth.xframe.utils.http.XHttp;
import com.youth.xframe.utils.log.XLog;
import com.youth.xframe.widget.XToast;


import butterknife.ButterKnife;

/**
 * 创建日期：2018/8/15 0015
 * 作者:Kite
 */
public class HomeShopFragment extends BaseFragment {

    /**
     * Fragment 实例
     */
    public static HomeShopFragment newInstance(Object... pramars) {
        HomeShopFragment fragment = new HomeShopFragment();
        fragment.setArguments(getBundle(pramars));
        return fragment;
    }

    @Override
    public View initView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_home_shop, container, false);
        return view;
    }

    @Override
    public void initData(Bundle savedInstanceState) {

    }

    @Override
    public void initView() {
//        netHttp();
    }

    private void netHttp(){
       XHttp.obtain().post("http://api.douban.com/v2/movie/top250?start=0&count=10", null, new HttpCallBack<Movie>() {
           @Override
           public void onSuccess(Movie o) {
               XLog.e("200");
               XToast.success(o.getCount()+"");
           }

           @Override
           public void onFailed(String error) {
               XLog.e("失败");
           }
       });
    }

}
